package com.LA_houseLease.common.context;

/**
 * ThreadLocal工具类
 * 封装啦ThreadLocal的常用方法
 * context:上下文
 */
public class BaseContext {
    public static ThreadLocal<LoginUser> threadLocal=new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser){
        threadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser(){
        return threadLocal.get();
    }

    public static void clear(){
        threadLocal.remove();
    }
}
